
#include<stdio.h>
int fit(int k,int n)
{
	if (k == 0)
		return 1;
	else
		return n * fit(k - 1, n);
	
}
int main()
{
	int k = 0;
	int n = 0;
	scanf_s("%d%d", &k,&n);
	int ret = fit(k,n);
	printf("%d", ret);
	return 0;
}